package cn.itcast.hiss.process.activiti.handler.sys.form;

import cn.itcast.hiss.cmd.handler.CmdHandler;
import cn.itcast.hiss.form.mapper.HissFormModelMapper;
import cn.itcast.hiss.form.pojo.HissFormModel;
import cn.itcast.hiss.form.service.HissFormModelService;
import cn.itcast.hiss.handler.HandlerIdClientEnum;
import cn.itcast.hiss.message.Message;
import cn.itcast.hiss.message.MessageContext;
import cn.itcast.hiss.message.sender.form.CreateFormDefinitionMessage;
import cn.itcast.hiss.message.sys.ProcessModelMessage;
import cn.itcast.hiss.message.sys.pojo.ProcessModel;
import cn.itcast.hiss.process.activiti.mapper.HissUserAppMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 *
 * @author: miukoo
 * @describe: 用户表单保存
 * @date: 2022/12/28 10:10
 */
@Component
@Slf4j
public class SYS_FormModelSaveHandler implements CmdHandler<CreateFormDefinitionMessage> {

    @Autowired
    private HissFormModelService hissFormModelService;

    @Override
    public void invoke(Message params, MessageContext messageContext) {

        hissFormModelService.saveFormDefinition((CreateFormDefinitionMessage)params, messageContext);
    }

    @Override
    public String getId() {
        return HandlerIdClientEnum.FORM_CREATE_FORM_DIFINITION.getId();
    }
}
